﻿@model NotifyPilot.WCF.Helpers.YammerConfigParameters

@{
    ViewBag.Title = "Yammer Configuration";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>@ViewBag.Title</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)
    @Html.EditorFor(model => model.Code)
    @Html.EditorFor(model => model.Token)
    <div class="form-group">
        @Html.LabelFor(model => model.ConsumerKey, new { @class = "control-label" })
        @Html.TextBoxFor(model => model.ConsumerKey, new { @class = "form-control" })
        @Html.ValidationMessageFor(model => model.ConsumerKey, null, new { @class = "has-error" })
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.ConsumerSecret, new { @class = "control-label" })
        @Html.TextBoxFor(model => model.ConsumerSecret, new { @class = "form-control" })
        @Html.ValidationMessageFor(model => model.ConsumerSecret, null, new { @class = "help-inline" })
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.PublishGroup, new { @class = "control-label" })
        @Html.TextBoxFor(model => model.PublishGroup, new { @class = "form-control" })
        @Html.ValidationMessageFor(model => model.PublishGroup, null, new { @class = "help-inline" })
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.DefaultTopic, new { @class = "control-label" })
        @Html.TextBoxFor(model => model.DefaultTopic, new { @class = "form-control" })
        @Html.ValidationMessageFor(model => model.DefaultTopic, null, new { @class = "help-inline" })
    </div>

    <div class="form-group">
        @Html.LabelFor(model => model.BackUrl, new { @class = "control-label" })
        @Html.TextBoxFor(model => model.BackUrl, new { @class = "form-control" })
        @Html.ValidationMessageFor(model => model.BackUrl, null, new { @class = "has-error" })
    </div>

    <div class="no-color">
        <button type="submit" value="Save" class="btn btn-default">Save</button>
        @if (Model != null && Model.HaveRequiredParameters)
        {
            @Html.ActionLink("Authorize Yammer to Interact with NotifyPilot", "YammerAuthorization", null, new { id = "i1", @class = "btn btn-primary" })
            @Html.ActionLink("Renew Yammer Token", "YammerRenewToken", null, new { id = "i2", @class = "btn btn-warning" })
            @Html.ActionLink("Test It", "TestPostOnYammer", null, new { title = "Post a test message to Yammer", id = "i2", @class = "btn btn-success" })
        }
    </div>
}
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

